﻿namespace USSDRunner
{
    using System;
    using System.Windows;
    
    /// <summary>
    /// Represents main page of the USSD Runner.
    /// </summary>
    public partial class MainPage
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MainPage"/> class.
        /// </summary>
        public MainPage()
        {
            InitializeComponent();

            // Set the data context of the listbox control to the sample data
            DataContext = App.ViewModel;
            this.Loaded += HandleMainPageLoaded;
        }

        // Load data for the ViewModel Parameters
        private static void HandleMainPageLoaded(object sender, RoutedEventArgs e)
        {
            // if (!App.ViewModel.IsDataLoaded)
            // {
            //     App.ViewModel.LoadData();
            // }
        }

        private void HandleMessageButtonClick(object sender, RoutedEventArgs e)
        {
            NavigationService.Navigate(new Uri("/MessagePage.xaml", UriKind.Relative));
        }
    }
}